<?php
require_once "settings.inc";
require_once "pageTools.inc";
require_once "etvFunctions.inc";

displayHtmlHeader("NMT playing a channel from Kartina.TV");
?>
<style type="text/css">
    a       { color: #46d0f0; }
    div     { color: white;   }
    td.page { height:<?php echo DEFAULT_PAGE_HEIGHT?>px; }
    table.logo { background-color : #46d0f0; padding: 2px; }
</style>
<?php
    displayHtmlBody();


    $path = urldecode($_GET['path']);
    $functions = new EtvFunctions();
    $url = $functions->getShortStreamUrl($path, $_GET['q']);
    if (EMBEDDED_BROWSER) {
        $url = preg_replace('|mms:|', 'rtsp:', $url);
    }

    # Combination onFocusLoad + onFocusSet forces this link to be
    # loaded automatically and when the video/audio will be stopped
    # the link written in onFocusSet will be immediately activated
    print '<a onFocusLoad onFocusSet="BACK" ';

    print "href=\"$url\" vod";
    if (BUFFER_SIZE > 0) {
        print " prebuf=\"" . (BUFFER_SIZE * 1024) . "\"";
    }
    print ">VIDEO</a>\n";

    # this onFocusLoad will be activated when the video will be stopped
    print '&nbsp;<a href="index.php?path=' . $_GET['path'] . '" name="BACK" onFocusLoad>';
    print "BACK</a><br>\n";
?>
